package com.fenghuajueli.libbasecoreui.adapter;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.List;

/**
 * ===========================================================
 * author：songpeng on 12/7/20 17:10
 * email：fenghuajueli@gmail.com
 * ===========================================================
 * 通用viewpage适配器
 */
public class CommPagerAdapter extends FragmentPagerAdapter {

    private List<Fragment> fragmentList;

    public CommPagerAdapter(List<Fragment> fragmentList, FragmentManager fm, int behavior) {
        super(fm, behavior);
        this.fragmentList = fragmentList;
    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }
}
